<template>
  <div class="svg-icon">
    <svg :class="'svg-icon ' + ($attrs.iconClass ? $attrs.iconClass : '')" :style="`color:${color};`">
      <use class="svg-use" :href="'#' + $attrs.iconName"/>
    </svg>
  </div>
</template>

<script setup lang="ts">

const props = defineProps({
  color: {
    type: String,
    default: '#FFFFFF'
  },
})

</script>

<style scoped lang="scss">

.svg-icon {
  display: inline-block;
  padding-left: 2px;
  cursor: pointer;
  opacity: 0.7;

  svg {
    width: 28px;
    height:28px;
    vertical-align: -0.15em;
    fill: currentColor;
    overflow: hidden;
    flex-shrink: 0;
  }
}

.svg-icon:hover {
  opacity: 1;
}
</style>
